<div id="content-top">
	<div id="indicator-image">
		<img src="<?php echo site_url()?>/media/images/index-poiter-blue.png"/>
	</div>
	<div id="main-menu">
		<div id="main-menu-header"><?php echo lang('devagno_menu_header_label')?></div>
		<ul>
			<li class="menu-separator"><hr/></li>
		<?php 
		if($mainMenus){
			foreach ($mainMenus as $mainMenu){
		?>
			<li>
			<?php
			if($mainMenu->url){
				$mainUrl = $mainMenu->url;
			}else{
				$mainUrl = site_url().$mainMenu->uri;
			}
			if(isset($mainMenu->subMenus)){
					if($mainMenu->subMenus[0]->url){
						$firstSubUrl = $mainMenu->subMenus[0]->url;
					}else{
						$firstSubUrl = site_url().$mainMenu->subMenus[0]->uri;
					}
			?>
				<a href="<?php echo $firstSubUrl?>"><?php echo $mainMenu->title?></a>
				<ul>
					<li><span><?php echo $mainMenu->title?></span>
					<li class="menu-separator"><hr/></li>
			<?php
				foreach ($mainMenu->subMenus as $subMenu) {
			?>
					<?php
					if($subMenu->url){
						$subUrl = $subMenu->url;
					}else{
						$subUrl = site_url().$subMenu->uri;
					}
					if(site_url(uri_string()) == $subUrl){
					?>
					<li><?php echo $subMenu->title?></li>
					<?php	
					}else{
					?>
					<li><a href="<?php echo $subUrl?>"><?php echo $subMenu->title?></a></li>
					<?php
					}
					?>
			<?php
				}
			?>
				</ul>
			<?php
			}else{
			?>
				<a href="<?php echo $mainUrl?>"><?php echo $mainMenu->title?></a>
			<?php
			}
			?>
			</li>
		<?php
			}
		}
		?>				
		</ul>	
	</div>
	<?php
	if($images && count($images) == 1){
		$image = $images[0];
	?>
	<div id="brief-page-image-wrapper">
		<div id="brief-page-image">
		<?php
		if($image){
		?>
			<img src="<?php echo site_url()?>/uploads/default/files/<?php echo $image->filename?>" />
		<?php
		}
		?>
		</div>
		<div id="brief-page-image-text">
		<?php
		if($image){
		?>
			<div class="brief-text-top">
				<?php echo $image->description?>
			</div>
			<div class="brief-text-separator">
			</div>
			<div class="brief-text-bottom">
				<?php echo $image->name?>
			</div>
		<?php
		}
		?>
		</div>
		<div class="clear"></div>
	</div>
	<?php
	}else{ 
	?>
	<div id="homepage-slideshow">
		<div class="slider-wrapper theme-default">
            <div class="ribbon"></div>
            <div id="slider" class="nivoSlider">
		<?php
		if($images){
			$i = 1;
			foreach ($images as $image){
		?>
			<img src="<?php echo site_url()?>/uploads/default/files/<?php echo $image->filename?>" alt="" title="#htmlcaption_<?php echo $i?>" />
		<?php
			$i++;
			}
		}
		?>
			</div>
            <div id="htmlcaption" class="nivo-html-caption">
                <strong>This</strong> is an example of a <em>HTML</em> caption with <a href="#">a link</a>.
            </div>
            <?php
			if($images){
				$i = 1;
				foreach ($images as $image){
			?>
				<div id="htmlcaption_<?php echo $i;?>" class="nivo-html-caption">
	                <div class="caption-top">
	                <?php echo $image->description?>
	                </div>
	                <div class="caption-separator">
	                </div>
	                <div class="caption-bottom">
	                <?php echo $image->name?>
	                </div>
            	</div>
			<?php
				$i++;
				}
			}
			?>
        </div>
	</div>
	<?php
	} 
	?>
</div>
<div class="content-bottom">
	<div id="brief-bottom-left">
		<div id="devagno-breadcrum">
			<ul>
				<li><a href="<?php echo site_url();?>" > <?php echo lang('devagno_menu_header_label')?></a></li>
				<li>
					<?php
					if($mainMenus[4]->url){
						$mainUrl = $mainMenus[4]->url;
					}else{
						$mainUrl = site_url().$mainMenus[4]->uri;
					}
					?>
					<a href="<?php echo $mainUrl?>"><?php echo $mainMenus[4]->title?>
					</a>
				</li>
				<?php
				if(site_url(uri_string()) !=$mainUrl){
				?>
				<li><a href="<?php echo site_url(uri_string())?>"><?php echo $page->title?></a></li>
				<?php	
				}
				?>
			</ul>
			<div class="clear"></div>
		</div>
		<div class="page-title">
			<h2><?php echo $page->title?></h2>
		</div>
		<ul id="mycarousel" class="jcarousel-skin-tango">
		<?php
		if($pageChunks){
			$i = 0;
			foreach ($pageChunks as $chunk){
		?>
			<li>				
				<?php echo $chunk->body;?>		
			</li>
		<?php
			}
		} 
		?>
		</ul>
	</div>
	<div id="brief-bottom-right">
		<ul id="sub-menu">
		<?php
		if($subMenuList){
			foreach ($subMenuList as $subMenu){
				if($subMenu->url){
					$subUrl = $subMenu->url;
				}else{
					$subUrl = site_url().$subMenu->uri;
				}
				if(site_url(uri_string()) == $subUrl){
					$class = 'class="active"';
				}else{
					$class ='';
				}
		?>
			<?php
			if(site_url(uri_string()) == $subUrl){
			?>
			<li <?php echo $class;?>><?php echo $subMenu->title?></li>
			<?php	
			}else{
			?>
			<li><a href="<?php echo $subUrl?>"><?php echo $subMenu->title?></a></li>
			<?php
			}
			?>
		<?php	
			}
		} 
		?>
		</ul>
	</div>
	<div class="clear"></div>
</div>